<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title>
<!-- CSS -->
<link href="./css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="./js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>

<script type="text/javascript">
function fun_userlogin(){
	
	$.ajax({
		type: "POST",
		url: "userLogin",
		dataType: "json",
		data: {
			"uname": $("#uname").val(),
			"password":$("#upwd").val()
		},success:function(data){
			if(data=="1"){
				alert("登录成功");
				location.href="./blogIndex";
			}else{
				alert("登录失败");
			}
		},error:function(data){
			alert(data);
		}
	});
	
}
</script>
</head>
<body>

	<!-- Top content -->
	<div class="top-content">

		<div class="inner-bg"></div>
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title ">用户登录</h3>
			</div>
			<div class="panel-body">
				<form role="form" action="" method="post" class="login-form">
					<div class="form-group">
						<label class="sr-only" for="form-username">用户名</label> <input
							type="text" id="uname" name="uname" placeholder="用户名..."
							class="form-username form-control" id="form-username">
					</div>
					<div class="form-group">
						<label class="sr-only" for="form-password">密码</label> <input
							type="password" id="upwd" name="form-password" placeholder="密码..."
							class="form-password form-control" id="form-password">
					</div>
					<button type="button" onclick="fun_userlogin()" class="btn">登录</button>
				</form>
			</div>
		</div>
	</div>



</body>

</html>